/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package controlacciones.ejb3.entity;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author vanessa
 */
@Entity
@Table(name = "tb_grupo_accion")
@NamedQueries({
    @NamedQuery(name = "TbGrupoAccion.findAll", query = "SELECT t FROM TbGrupoAccion t"),
    @NamedQuery(name = "TbGrupoAccion.findByCodGrupoAccion", query = "SELECT t FROM TbGrupoAccion t WHERE t.codGrupoAccion = :codGrupoAccion")})
public class TbGrupoAccion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "cod_grupo_accion")
    private String codGrupoAccion;
    @OneToMany(mappedBy = "codGrupoAccion")
    private Collection<TbAccion> tbAccionCollection;
    @OneToMany(mappedBy = "codGrupoAccion")
    private Collection<TbValorizacion> tbValorizacionCollection;

    public TbGrupoAccion() {
    }

    public TbGrupoAccion(String codGrupoAccion) {
        this.codGrupoAccion = codGrupoAccion;
    }

    public String getCodGrupoAccion() {
        return codGrupoAccion;
    }

    public void setCodGrupoAccion(String codGrupoAccion) {
        this.codGrupoAccion = codGrupoAccion;
    }

    public Collection<TbAccion> getTbAccionCollection() {
        return tbAccionCollection;
    }

    public void setTbAccionCollection(Collection<TbAccion> tbAccionCollection) {
        this.tbAccionCollection = tbAccionCollection;
    }

    public Collection<TbValorizacion> getTbValorizacionCollection() {
        return tbValorizacionCollection;
    }

    public void setTbValorizacionCollection(Collection<TbValorizacion> tbValorizacionCollection) {
        this.tbValorizacionCollection = tbValorizacionCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codGrupoAccion != null ? codGrupoAccion.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TbGrupoAccion)) {
            return false;
        }
        TbGrupoAccion other = (TbGrupoAccion) object;
        if ((this.codGrupoAccion == null && other.codGrupoAccion != null) || (this.codGrupoAccion != null && !this.codGrupoAccion.equals(other.codGrupoAccion))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "controlacciones.ejb3.entity.TbGrupoAccion[codGrupoAccion=" + codGrupoAccion + "]";
    }

}
